ActivityOptionsCompat

Helper for accessing features in android.app.ActivityOptions in a backwards compatible fashion.

Types

Link copied to clipboard
Enumeration of background activity start modes.

Properties

Link copied to clipboard
val EXTRA_USAGE_TIME_REPORT: String = "android.activity.usage_time"
A long in the extras delivered by requestUsageTimeReport that contains the total time (in ms) the user spent in the app flow.
Link copied to clipboard
val EXTRA_USAGE_TIME_REPORT_PACKAGES: String = "android.usage_time_packages"
A Bundle in the extras delivered by requestUsageTimeReport that contains detailed information about the time spent in each package associated with the app; each key is a package name, whose value is a long containing the time (in ms).

Functions

Link copied to clipboard
Returns the bounds that should be used to launch the activity.
Link copied to clipboard
Gets the id of the display where activity should be launched.
Link copied to clipboard
Create a basic ActivityOptions that has no special animation associated with it.
Link copied to clipboard
open fun makeClipRevealAnimation(@NonNull source: View, startX: Int, startY: Int, width: Int, height: Int): ActivityOptionsCompat
Create an ActivityOptions specifying an animation where the new activity is revealed from a small originating area of the screen to its final full representation.
Link copied to clipboard
open fun makeCustomAnimation(@NonNull context: Context, enterResId: Int, exitResId: Int): ActivityOptionsCompat
Create an ActivityOptions specifying a custom animation to run when the activity is displayed.
Link copied to clipboard
open fun makeScaleUpAnimation(@NonNull source: View, startX: Int, startY: Int, startWidth: Int, startHeight: Int): ActivityOptionsCompat
Create an ActivityOptions specifying an animation where the new activity is scaled from a small originating area of the screen to its final full representation.
Link copied to clipboard
open fun makeSceneTransitionAnimation(@NonNull activity: Activity, @NonNull sharedElement: View, @NonNull sharedElementName: String): ActivityOptionsCompat
Create an ActivityOptions to transition between Activities using cross-Activity scene animations.
Link copied to clipboard
If set along with Intent.FLAG_ACTIVITY_NEW_DOCUMENT then the task being launched will not be presented to the user but will instead be only available through the recents task list.
Link copied to clipboard
open fun makeThumbnailScaleUpAnimation(@NonNull source: View, @NonNull thumbnail: Bitmap, startX: Int, startY: Int): ActivityOptionsCompat
Create an ActivityOptions specifying an animation where a thumbnail is scaled from a given position to the new activity window that is being started.
Link copied to clipboard
Ask the the system track that time the user spends in the app being launched, and report it back once done.
Link copied to clipboard
open fun setLaunchBounds(@Nullable screenSpacePixelRect: Rect): ActivityOptionsCompat
Sets the bounds (window size) that the activity should be launched in.
Link copied to clipboard
Sets the id of the display where the activity should be launched.
Sets the mode for allowing or denying the senders privileges to start background activities to the PendingIntent.
Link copied to clipboard
Sets whether the identity of the launching app should be shared with the activity.
Link copied to clipboard
Returns the created options as a Bundle, which can be passed to startActivity.
Link copied to clipboard
open fun update(@NonNull otherOptions: ActivityOptionsCompat)
Update the current values in this ActivityOptions from those supplied in otherOptions.